import React from 'react'
import { Tabs } from 'antd'
import type { TabsProps } from 'antd'
import { HomeOutlined } from '@ant-design/icons'

export interface TabViewProps {
  activeKey: string
  onChange: (key: string) => void
  onEdit: (targetKey: string | React.MouseEvent | React.KeyboardEvent, action: 'add' | 'remove') => void
  items: TabsProps['items']
}

const TabView: React.FC<TabViewProps> = ({ activeKey, onChange, onEdit, items }) => {
  return (
    <Tabs
      hideAdd
      onChange={onChange}
      activeKey={activeKey}
      type="editable-card"
      onEdit={onEdit}
      items={items}
    />
  )
}

export default TabView